package com.xique.system.api;

import com.xique.common.core.constant.ServiceNameConstants;
import com.xique.common.core.domain.R;
import com.xique.system.api.dto.SystemProjectDTO;
import com.xique.system.api.factory.RemoteSystemProjectFallbackFactory;
import com.xique.system.api.request.RemoteSystemProjectAllListRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author shd
 * @create 2021/7/20 16:12
 */
@FeignClient(contextId = "RemoteSystemProjectService", value = ServiceNameConstants.SYSTEM_BIZ_SERVICE, fallbackFactory = RemoteSystemProjectFallbackFactory.class)
public interface RemoteSystemProjectService {

    /**
     * 通过id查询项目信息
     *
     * @param parkId 用户名
     * @return 结果
     */
    @GetMapping(value = "project/info/{parkId}")
    R<SystemProjectDTO> getProjectInfo(@PathVariable("parkId") Long parkId);

    /**
     * 获取项目列表
     *
     * @param request
     * @return com.xique.common.core.domain.R<java.util.List < com.xique.system.api.dto.SystemProjectDTO>>
     * @author shd
     * @date 2022/4/18 8:51
     */
    @PostMapping(value = "project/allList")
    R<List<SystemProjectDTO>> getProjectList(@RequestBody RemoteSystemProjectAllListRequest request);
}
